home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / maximus / mul100.zip / REMDEM.SCR < prev    next >
Text File  |  1993-02-01  |  2KB  |  59 lines

  1.  
  2. // REMDEM.SCR  --  Remove All Record Demote Flags  --  Version 1.00
  3. //
  4. // Script program for MUL - the Maximus User Language
  5. // MUL is (C) Copyright 1990-93 by CodeLand Australia
  6.  
  7. // Originally written for Simon Blears of 3:690/601, REMDEM removes the
  8. // demote flag settings from all user records.
  9.  
  10. char *ufile = "USER.BBS";                   // Path & name of Maximus user file
  11. //char *ufile = "C:\\BBS\\USER.BBS";        // Path & name of Maximus user file
  12.  
  13. char *banner = "REMDEM v1.00";              // Script banner
  14. char *desc = "Remove All Demote Flags";     // Description
  15.  
  16. main ()                                     // Main program
  17. {
  18.     printf ("\n%s - %s\n\n",banner,desc);   // Announce
  19.  
  20.     if (!BaseOpen (ufile)) {
  21.         printf ("ERROR opening user file %s\n",ufile);
  22.         saybibi (); exit ();
  23.     }
  24.  
  25.     printf("Found %d user records\n\n", BaseCount());
  26.  
  27.     scanufile ();                           // Process the user file
  28.  
  29.     BaseClose ();                           // Close the user base
  30.     saybibi ();                             // Was it good for you too?
  31. }
  32.  
  33. scanufile ()                                // Process the user file
  34. {
  35.     int rec=1;
  36.  
  37.     while (BaseRead (rec)) {                // Read all records
  38.  
  39.         if (And (USRxpflag,XP_DEMOTE)) {    // If expire by date
  40.  
  41.             printf("Removing DEMOTE flag: record %04d %s\n", rec-1, USRname);
  42.  
  43.             USRxpflag = And (USRxpflag, Invert (XP_DEMOTE));
  44.             BaseWrite (rec);
  45.         }
  46.  
  47.         ++rec;
  48.     }
  49. }
  50.  
  51. // Byebye
  52. saybibi ()
  53. {                             
  54.     puts ("\nRemDem done!\n");
  55. }
  56.  
  57. // End of script
  58.  
  59.